<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>eRPC API Reference: erpc::InterThreadBufferTransport Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">eRPC API Reference
   &#160;<span id="projectnumber">Rev. 1.5.0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classerpc_1_1_inter_thread_buffer_transport.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classerpc_1_1_inter_thread_buffer_transport-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">erpc::InterThreadBufferTransport Class Reference<div class="ingroups"><a class="el" href="group__transports.html">Transport Layers</a> &raquo; <a class="el" href="group__itbp__transport.html">Inter-thread</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Very basic transport to send/receive messages between threads.  
 <a href="classerpc_1_1_inter_thread_buffer_transport.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="inter__thread__buffer__transport_8h_source.html">inter_thread_buffer_transport.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for erpc::InterThreadBufferTransport:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="classerpc_1_1_inter_thread_buffer_transport__inherit__graph.svg" width="218" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for erpc::InterThreadBufferTransport:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="classerpc_1_1_inter_thread_buffer_transport__coll__graph.svg" width="735" height="206"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html#structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state">SharedState</a></td></tr>
<tr class="separator:structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5665c4538484bc71c3571c5ef7a36519"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5665c4538484bc71c3571c5ef7a36519"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>linkWithPeer</b> (<a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html">InterThreadBufferTransport</a> *peer)</td></tr>
<tr class="separator:a5665c4538484bc71c3571c5ef7a36519"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc8619a2b970c2c5fbdfa7e464b2fbf4"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html#afc8619a2b970c2c5fbdfa7e464b2fbf4">receive</a> (<a class="el" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *message)</td></tr>
<tr class="memdesc:afc8619a2b970c2c5fbdfa7e464b2fbf4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prototype for receiving message.  <a href="#afc8619a2b970c2c5fbdfa7e464b2fbf4">More...</a><br /></td></tr>
<tr class="separator:afc8619a2b970c2c5fbdfa7e464b2fbf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94b907643bacde4a9ba4379b10da1b4d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a94b907643bacde4a9ba4379b10da1b4d"></a>
virtual <a class="el" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>send</b> (const <a class="el" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *message)</td></tr>
<tr class="separator:a94b907643bacde4a9ba4379b10da1b4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae369a7c286a2935828730246d10bcc5e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae369a7c286a2935828730246d10bcc5e"></a>
virtual int32_t&#160;</td><td class="memItemRight" valign="bottom"><b>getAvailable</b> () const </td></tr>
<tr class="separator:ae369a7c286a2935828730246d10bcc5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classerpc_1_1_transport"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classerpc_1_1_transport')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classerpc_1_1_transport.html">erpc::Transport</a></td></tr>
<tr class="memitem:a895a468f9810eba023c68197edefb301 inherit pub_methods_classerpc_1_1_transport"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a895a468f9810eba023c68197edefb301"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_transport.html#a895a468f9810eba023c68197edefb301">Transport</a> ()</td></tr>
<tr class="memdesc:a895a468f9810eba023c68197edefb301 inherit pub_methods_classerpc_1_1_transport"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a895a468f9810eba023c68197edefb301 inherit pub_methods_classerpc_1_1_transport"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac75843918e2fbe211430cf5973caac47 inherit pub_methods_classerpc_1_1_transport"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac75843918e2fbe211430cf5973caac47"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_transport.html#ac75843918e2fbe211430cf5973caac47">~Transport</a> ()</td></tr>
<tr class="memdesc:ac75843918e2fbe211430cf5973caac47 inherit pub_methods_classerpc_1_1_transport"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classerpc_1_1_transport.html" title="Abstract interface for transport layer. ">Transport</a> destructor. <br /></td></tr>
<tr class="separator:ac75843918e2fbe211430cf5973caac47 inherit pub_methods_classerpc_1_1_transport"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ede71b16625cba746818294148f9aba inherit pub_methods_classerpc_1_1_transport"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_transport.html#a4ede71b16625cba746818294148f9aba">send</a> (<a class="el" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *message)=0</td></tr>
<tr class="memdesc:a4ede71b16625cba746818294148f9aba inherit pub_methods_classerpc_1_1_transport"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prototype for send message.  <a href="#a4ede71b16625cba746818294148f9aba">More...</a><br /></td></tr>
<tr class="separator:a4ede71b16625cba746818294148f9aba inherit pub_methods_classerpc_1_1_transport"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abee09d5af8f4a38ae83891afc6472066 inherit pub_methods_classerpc_1_1_transport"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_transport.html#abee09d5af8f4a38ae83891afc6472066">hasMessage</a> ()</td></tr>
<tr class="memdesc:abee09d5af8f4a38ae83891afc6472066 inherit pub_methods_classerpc_1_1_transport"><td class="mdescLeft">&#160;</td><td class="mdescRight">Poll for an incoming message.  <a href="#abee09d5af8f4a38ae83891afc6472066">More...</a><br /></td></tr>
<tr class="separator:abee09d5af8f4a38ae83891afc6472066 inherit pub_methods_classerpc_1_1_transport"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a077e72c8afa8caa483220faf45df62c6 inherit pub_methods_classerpc_1_1_transport"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classerpc_1_1_transport.html#a077e72c8afa8caa483220faf45df62c6">setCrc16</a> (<a class="el" href="classerpc_1_1_crc16.html">Crc16</a> *crcImpl)</td></tr>
<tr class="memdesc:a077e72c8afa8caa483220faf45df62c6 inherit pub_methods_classerpc_1_1_transport"><td class="mdescLeft">&#160;</td><td class="mdescRight">This functions sets thre CRC-16 implementation.  <a href="#a077e72c8afa8caa483220faf45df62c6">More...</a><br /></td></tr>
<tr class="separator:a077e72c8afa8caa483220faf45df62c6 inherit pub_methods_classerpc_1_1_transport"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a87b2fa2a4a4cdb06004758f415c7df80"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a87b2fa2a4a4cdb06004758f415c7df80"></a>
<a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html#structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state">SharedState</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_state</b></td></tr>
<tr class="separator:a87b2fa2a4a4cdb06004758f415c7df80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4737f5dbd399a00ebf8704a38932d835"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4737f5dbd399a00ebf8704a38932d835"></a>
<a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html">InterThreadBufferTransport</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_peer</b></td></tr>
<tr class="separator:a4737f5dbd399a00ebf8704a38932d835"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a8f7d263d56367f2adc3823fa67ee72"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0a8f7d263d56367f2adc3823fa67ee72"></a>
<a class="el" href="classerpc_1_1_semaphore.html">Semaphore</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_inSem</b></td></tr>
<tr class="separator:a0a8f7d263d56367f2adc3823fa67ee72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a646c044009f98b950885d37796193e7c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a646c044009f98b950885d37796193e7c"></a>
<a class="el" href="classerpc_1_1_semaphore.html">Semaphore</a>&#160;</td><td class="memItemRight" valign="bottom"><b>m_outSem</b></td></tr>
<tr class="separator:a646c044009f98b950885d37796193e7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b5a020049b2375c5e4e99dfb9726281"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b5a020049b2375c5e4e99dfb9726281"></a>
<a class="el" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>m_inBuffer</b></td></tr>
<tr class="separator:a3b5a020049b2375c5e4e99dfb9726281"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Very basic transport to send/receive messages between threads. </p>
<p>Can send and receive message buffers to/from another instance of the same class associated with another thread. Only one other thread may be communicated with. To set things up first create two instances. Then call the linkWithPeer() method on the first one, passing the second. The two instances of this class do not have to be created on their respective threads, but the send() and <a class="el" href="classerpc_1_1_inter_thread_buffer_transport.html#afc8619a2b970c2c5fbdfa7e464b2fbf4" title="Prototype for receiving message. ">receive()</a> calls must be invoked on the appropriate thread.</p>
<p>Only a single message may be pending for each of the two threads. If a message is pending for a thread and another is sent, then the sender will block until the currently pending message is received. </p>
</div><hr/><h2 class="groupheader">Class Documentation</h2>
<a name="structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state" id="structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct erpc::InterThreadBufferTransport::SharedState</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"></div><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-2-trigger" src="closed.png" alt="+"/> Collaboration diagram for erpc::InterThreadBufferTransport::SharedState:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="structerpc_1_1_inter_thread_buffer_transport_1_1_shared_state__coll__graph.svg" width="218" height="142"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="fieldtable">
<tr><th colspan="3">Class Members</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a0fe81cb63071c7d696cc2a3d0291df67"></a><a class="el" href="classerpc_1_1_mutex.html">Mutex</a></td>
<td class="fieldname">
m_mutex</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="afc8619a2b970c2c5fbdfa7e464b2fbf4"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infra.html#ga5f8872e58f09a16d192bf664f9898651">erpc_status_t</a> InterThreadBufferTransport::receive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classerpc_1_1_message_buffer.html">MessageBuffer</a> *&#160;</td>
          <td class="paramname"><em>message</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Prototype for receiving message. </p>
<p>Each transport layer need define this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">message</td><td>Will return pointer to received message buffer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>based on receive implementation. </dd></dl>

<p>Implements <a class="el" href="classerpc_1_1_transport.html#a3f886733620e1a2fe00d12f36711dde5">erpc::Transport</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="inter__thread__buffer__transport_8h_source.html">inter_thread_buffer_transport.h</a></li>
<li>inter_thread_buffer_transport.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
